import React,{Component} from 'react';
import {View,Text,ImageBackground,StatusBar,TouchableOpacity} from 'react-native';
import { pxToDp } from '../../utils/stylesKits';
import IconFont from '../IconFonts'
import {NavigationContext} from '@react-navigation/native'

    class Index extends Component{
        static contextType = NavigationContext
        render(){
            return(
                <View>
                    <StatusBar backgroundColor='transparent' translucent={true} />
                    <ImageBackground 
                    style={{height:pxToDp(60),paddingTop:pxToDp(12),flexDirection:'row',alignItems:'center',justifyContent:'space-between'}}
                    source={require('../../res/headbg.png')}>
                        <TouchableOpacity onPress={this.context.goBack} style={{flexDirection:'row',alignItems:'center',width:pxToDp(80)}}>
                            <IconFont name="iconfanhui" style={{color:'#fff'}} />
                            <Text style={{color:'#fff'}}>返回</Text>
                        </TouchableOpacity>
                        <Text style={{color:'#fff',fontSize:pxToDp(20),fontWeight:'bold'}}>{this.props.title}</Text>
                        <Text style={{width:pxToDp(80)}}></Text>
                    </ImageBackground>
                </View>
            );
        }
    }
export default Index;